<template>
<div class="home">
    <h3>这是主页面</h3>   
    <div>
        <p>{{ $store.state.a }}</p>
        <button @click="$store.commit('addA',10)">addA</button>
        <button @click="$store.state.a++">addA</button>


        <p>{{ $store.state.b }}</p>
        <button @click="$store.commit('addB',2)">addB</button>
    </div>

</div>
</template>

<script>
// @ is an alias to /src

export default {
    name: 'HomeView',
    components: {

    },
    mounted(){
        console.log(this);
        console.log(this.$store);
        console.log(this.$store.state);
    }
}
</script>
